Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix parsing url strings with brackets #423

Merged
merged 4 commits into from
Jul 15, 2019

Conversation

nejcvivod
Copy link
Contributor

There seems to be an issue (on ios at least) where URLs with [] query parameters are not parsed; URLComponents will produce nil so routing won't succeed.

This fix escapes the strings by percent-encoding them so query parameters should now work as expected.

Added unit test for such a case

* when path contains 'weird' characters (`[]`) URLComponents won't parse it, so the path will be nil
  * escaping the string with `urlQueryAllowed` character set fixes this issue
@swifter-bot
Copy link

swifter-bot commented Jul 11, 2019

2 Warnings
⚠️ It seems like you’ve added new tests to the library. If that’s the case, please update the XCTestManifests.swift file running in your terminal the command swift test --generate-linuxmain.
⚠️ If you ran the command swift test --generate-linuxmain in your terminal, please remove the line testCase(IOSafetyTests.__allTests__IOSafetyTests), from public func __allTests() -> [XCTestCaseEntry] in the bottom of the file. For more reference see #366.
1 Message
📖 Hey, @nejcvivod 👋.

Generated by 🚫 Danger

@Vkt0r
Copy link
Member

Vkt0r commented Jul 12, 2019

@nejcvivod Thanks for creating this PR! That's a good catch, can you please provide an entry in the CHANGELOG in order to review your PR?

* added `update` entries to CHANGELOG.md describing fixed parsing & new test
* fix invalid test, don't need the full domain in parser
* ran `swift test --generate-linuxmain`
@nejcvivod
Copy link
Contributor Author

@Vkt0r updated changelog & ran the command @swifter-bot posted :)

CHANGELOG.md Outdated Show resolved Hide resolved
@nejcvivod
Copy link
Contributor Author

@Vkt0r updated

Copy link
Member

@Vkt0r Vkt0r left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good to me @nejcvivod. Thanks again for your contribution!

@Vkt0r Vkt0r merged commit 73ac810 into httpswift:stable Jul 15, 2019
tomieq pushed a commit to tomieq/swifterfork that referenced this pull request Apr 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants